#!/usr/bin/perl

use strict;

sub file_begin {
    print '<?xml version="1.0" encoding="UTF-8"?>' , "\n";
    print <<_EOH_;

_EOH_
}

sub file_end {
    print "\n";
}

sub entry_basiclib {
    my ($libname) = @_;
    printf("<manifest:file-entry manifest:media-type=\"application/vnd.sun.star.basic-library\" \n                     manifest:full-path=\"%s\"/>\n", $libname);
}

sub entry_dialoglib {
    my ($libname) = @_;
    printf("<manifest:file-entry manifest:media-type=\"application/vnd.sun.star.dialog-library\" \nmanifest:full-path=\"%s\"/>", $libname);
}

sub entry_configdata {
    my ($libname) = @_;
    $libname .= ".xcu"
        unless $libname =~ /\.xcu/;
    printf("<manifest:file-entry manifest:media-type=\"application/vnd.sun.star.configuration-data\" \nmanifest:full-path=\"%s\"/>", $libname);
}

#use Data::Dumper;

#sub entry_tooltip {
#    my (%tooltips) = @_;
#    #print Dumper(\%tooltips);
#    foreach my $lang (keys %tooltips) {
#       printf("<manifest:file-entry manifest:media-type=\"application/vnd.sun.star.package-bundle-description;locale=%s\" \nmanifest:full-path=\"%s\" />", $lang, $tooltips{$lang});
#    }
    
    #sprintf("<manifest:file-entry manifest:media-type=\"application/vnd.sun.star.package-bundle-description;locale=en\" \nmanifest:full-path=\"readme.en\" />",);
    #sprintf("<manifest:file-entry manifest:media-type=\"application/vnd.sun.star.package-bundle-description\" \nmanifest:full-path=\"readme.en\" />",);
#}
#    <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description;locale=de" 
# manifest:full-path="readme.de" />
#  <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description" 
# manifest:full-path="readme.txt" />
#}

&file_begin;
&entry_basiclib("Standard/");
#&entry_tooltip( ( "en" => 'readme.en', 'fi' => 'readme.txt' ) );
&file_end;
